home *** CD-ROM | disk | FTP | other *** search
/ Aminet 7 / Aminet 7 - August 1995.iso / Aminet / comm / net / DialupV3_03.lha / dialup / dialup.c < prev    next >
C/C++ Source or Header  |  1994-11-03  |  16KB  |  405 lines

  1. ;/*
  2. If EXISTS misc:dialup
  3.     set pname=misc:dialup
  4. ELSE
  5.     set pname=dialup
  6. ENDIF
  7. Failat 1
  8. SC PNAME $pname dialup.c commands.c io.c util.c
  9. resi dialup -delete
  10. resi $pname
  11. IF EXISTS $pname.lnk
  12.     delete $pname.lnk QUIET
  13. EndIf
  14. IF EXISTS $pname.lnk
  15.     delete $pname.lnk QUIET
  16. EndIf
  17. QUIT $RC
  18. */
  19.  
  20. #include "dialup.h"
  21.  
  22. static const char version[] = "$VER: Dialup 3.05 (04.11.94)";
  23.  
  24. BPTR                mystderr        = NULL;
  25. const UBYTE         *prgname        = NULL;
  26. struct IOExtSer        *serialIOReq    = NULL;
  27. struct timerequest    *timereq        = NULL;
  28. BPTR                repfile            = NULL;
  29. UBYTE                *rxbuffer        = NULL;
  30. LONG                arg[A_ALL + 1];
  31.  
  32. struct argspec argtab[] = {
  33.  
  34.     "COMMAND=CMD",                 (LONG)"TOGGLE"            ,    /* only TOGGLE                     */
  35.     "PHONENUMBER=PN/K/M",         NULL                    ,    /* ptr to PN *array* init later  */
  36.     "REDIALDELAY=RDD/K/N",         (LONG)"\0\0\0\xB4"        ,    /* Delay for *same* number 180s  */
  37.     "MODEMCONNECTTIME=MCT/K/N",     (LONG)"\0\0\0\x3D"        ,    /* Time to connect 61s             */
  38.     "RINGS=RGS/K/N",             (LONG)"\0\0\0\x01"        ,    /* AUTOANSWER after 1 RING         */
  39.     "WAITBEFORWUS=WBW/K/N",         (LONG)"\0\0\0\x03"        ,    /* Wait befor sending WUS         */
  40.     "WAKEUPSTRING=WUS/K",         NULL                    ,    /* String to sent to get a ogin: */
  41.     "LOGINPROMPT=LIP/K",         (LONG)"ogin:"            ,    /* prompt of remotesite             */
  42.     "LOGINTIMEOUT=LTO/K/N",         (LONG)"\0\0\0\x03"        ,    /* Time to wait for the loginprompt */
  43.     "LOGINNAME=LIN/K",             NULL                    ,    /* Name to answer at A_LIP         */
  44.     "PASSWORDPROMPT=PWP/K",         (LONG)"assword:"        ,    /* prompt for password             */
  45.     "PASSWORD=PW/K",             NULL                    ,    /* password                         */
  46.     "SNDLOGINPROMPT=SLIP/K",     (LONG)"ogin:"            ,    /* prompt of remotesite             */
  47.     "SNDLOGINNAME=SLIN/K",         NULL                    ,    /* Name to answer at A_LIP         */
  48.     "SNDPASSWORDPROMPT=SPWP/K",     (LONG)"assword:"        ,    /* prompt for snd password         */
  49.     "SNDPASSWORD=SPW/K",         NULL                    ,    /* snd password                     */
  50.     "LOGINOK=LOK/K",             (LONG)"Packet mode"    ,    /* answer for correct login         */
  51.     "LOGINOKTIMEOUT=LOT/K/N",     (LONG)"\0\0\0\x03"        ,    /* Time to wait for the LOK Msg     */
  52.     "VERBOSE/S",                 NULL                    ,    /* debuginig stuff active         */
  53.     "TEST/S",                     NULL                    ,    /* local analog loopback         */
  54.     "NOSERINIT=NSI/S",             NULL                    ,    /* init. of serial line ?         */
  55.     "NODTRIGNORE=NDI/S",         NULL                    ,    /* Do not send AT&D0 AT&D2         */
  56.     "REPORTFILE=RPF/K",             NULL                    ,    /* where to put report ?         */
  57.     "QUIET/S",                     NULL                    ,    /* No report of conversation     */
  58.     "STDERR/S",                     NULL                    ,    /* errormessages to *             */
  59.     "AUTOANSWER=AA/S",             NULL                    ,    /* take call after hangup         */
  60.     "NORECONNECT=NRC/S",         NULL                    ,    /* do not take call while conn.     */
  61.     "SANADEVICE=SAD/K",             (LONG)"Networks/rhcslip.device", /* sana device to use         */
  62.     "SANAUNIT=SAU/K/N",             (LONG)"\0\0\0\0"        ,    /* and its unit                     */
  63.     "SANACONFIGFILE=SCF/K",         (LONG)"slip%d.config"    ,    /* name of the sana config file  */
  64.     "CONNECTSTRING=CS/K",         (LONG)"CONNECT?*19200/V42b", /* part of the std. connectstr.*/ 
  65.  
  66.     "MODEMSETTINGSCONNECT=MSC/K",(LONG)"ATZ1"            ,    /* settings for connect             */
  67.     "MODEMSETTINGSHANGUP=MSH/K", (LONG)"ATZ1"            ,    /* settings after hang up         */
  68.     "MODEMQUERYCMD=MQC/K",         (LONG)"AT&VI2"            ,    /* cmd to query modemstatus         */
  69.     "MODEMREADYCMD=MRC/K",         (LONG)"AT"                ,    /* Modem should answer with OK     */
  70.     "MODEMHANGUPCMD=MHC/K",         (LONG)"ATH0"            ,    /* Modem cmd to drop connection  */
  71.     "MODEMCMDOK=MOK/K",             (LONG)"OK"                ,    /* Answer from modem if cmd OK     */
  72.     "MODEMNOCARRIER=MNC/K",          (LONG)"NO CARRIER"        ,    /* modemanswer if not carrier    */
  73.     "MODEMLINEBUSY=MLB/K",         (LONG)"BUSY"            ,    /* modemanswer if line busy         */
  74.     "MODEMLINEDEAD=MLD/K",         (LONG)"NO DIALTONE"    ,    /* modemanswer if there is no dt */
  75.     "MODEMRING=MRG/K",              (LONG)"RING"            ,    /* incoming call                 */
  76.     "MODEMANYCONNECT=MAC/K",     (LONG)"CONNECT?*\n"    ,    /* modemanswer if any connect     */
  77.     "MODEMAACMD=MAAC/K",         (LONG)"ATS0=%d"        ,    /* Set modem to auto answer         */
  78.     "MODEMOFFLINECMD=MOC/K",     (LONG)"+++"            ,    /* Make modem accept commands     */
  79.     "MODEMONLINECMD=MLC/K",         (LONG)"ATO"            ,    /* Make modem online again         */
  80.     "MODEMTESTCMD=MTC/K",         (LONG)"AT&T1"            ,    /* Make modem loopback             */
  81.     "MODEMTESTOFFCMD=MTO/K",     (LONG)"AT&T0"            ,    /* Make modem stop loopback      */
  82.     "MODEMTOFFHOOKCMD=MOH/K",     (LONG)"ATA"            ,    /* Make modem stop loopback      */
  83.  
  84.     "GIVEALLSETTINGS=ALL=GAS/S", NULL                     ,    /* show all defaults             */ 
  85.     NULL,                         NULL                    };    /* END of list                     */
  86.  
  87.     UBYTE *PNAdeflt[] = { "ATDS1", NULL };
  88.  
  89.  
  90. int
  91. main(int argc, BYTE **argv)
  92.     {
  93.     int result = 20;
  94.  
  95.     /* resurce pointers and resurce openflags: */
  96.     struct MsgPort        *sanaport        = NULL;
  97.     struct IOSana2Req    *sanaIOReq        = NULL;
  98.     struct MsgPort        *serialport        = NULL;
  99.     struct MsgPort        *timeport        = NULL;
  100.     struct RDArgs        *rdclargs        = NULL;
  101.     struct RDArgs        *rdenvargs        = NULL;
  102.     UBYTE                *varbuf            = NULL;
  103.  
  104.     LONG sanaopenerr = TRUE;
  105.     LONG seropenerr = TRUE;
  106.     LONG timeopenerr = TRUE;
  107.  
  108.     /* flags */
  109.     BOOL putOnline        = FALSE;
  110.     BOOL giveusage        = FALSE;
  111.     BOOL giveDefault    = FALSE;
  112.  
  113.     struct SP serpara;    /* serial parameters from of sana device (slip0.config) */
  114.     UBYTE hostname[30];    /* stringbuffer */
  115.     UBYTE *template;
  116.     LONG argd[A_END + 1];
  117.     UBYTE **pn;            /* array of phonenumbers */
  118.  
  119.     prgname = argv[0];
  120.  
  121.     if (((struct Library *)DOSBase)->lib_Version < 37 ) return(200);
  122.     if (!unique(serialport)) return (4);
  123.     if ( ! (varbuf = AllocMem(VARBUFSIZE, MEMF_CLEAR|MEMF_PUBLIC) ) || ! (template = AllocMem(TEMPLATESIZE, MEMF_CLEAR|MEMF_PUBLIC) ) )
  124.         CUP("Error allocating memory", 51);
  125.     giveDefault = (argc > 1 && ABBREV(argv[1], "DE") );
  126.  
  127.     initDefaultsAndTemplate(template);
  128.     if ( strlen(template) > TEMPLATESIZE - 50 ) CUP("Template buffer to small", 52);
  129.  
  130.     pn = PNAdeflt;
  131.  
  132.     /* check environment variable: */
  133.     if ( GetVar( "DIALUP",  varbuf,  VARBUFSIZE, 0 ) != -1 )
  134.         { /* parse env:dialup */
  135.         if ( ! ( rdenvargs = AllocDosObject( DOS_RDARGS, NULL) ) ) CUP("Can't allocate DosObject for reading args", 50);
  136.  
  137.         rdenvargs->RDA_Source.CS_Buffer = varbuf;
  138.         rdenvargs->RDA_Source.CS_Length = VARBUFSIZE;
  139.         rdenvargs->RDA_Source.CS_CurChr = 0;
  140.  
  141.         /* ReadArgs() requires that the line be null-terminated or funny things happen. */
  142.         strcat(varbuf, "\n");
  143.         if( !ReadArgs( template, arg, rdenvargs ) )
  144.             {
  145.             Fault(IoErr(), prgname, varbuf, VARBUFSIZE);
  146.             CUP1("Error parsing environment variable 'DIALUP':\n%s", varbuf, 20);
  147.             }
  148.         if ( arg[A_PN] ) pn = (UBYTE **)arg[A_PN]; /* save pns for next call to ReadArgs() */
  149.         }
  150.  
  151.     adjustdefs();
  152.  
  153.     if ( giveDefault ) if ( !initDefaultsTemplate(template, argd) ) CUP("MAXARGNAMELEN to small!", 53);
  154.  
  155.     /* parse for command line for paramters or defaultkeywords: */
  156.     if ( ! ( rdclargs = ReadArgs(template, giveDefault ? argd : arg, NULL ) ) )
  157.         {
  158.         Fault(IoErr(), prgname, varbuf, VARBUFSIZE);
  159.         CUP1("Error parsing command line.\n%s", varbuf, 20);
  160.         };
  161.     if ( template )    { FreeMem( template, TEMPLATESIZE ); template = NULL; };
  162.  
  163.     adjustdefs();
  164.  
  165.     if ( !arg[A_PN]  ) arg[A_PN] = (LONG)pn; /* corrects a Bug in Readargs(): /M arrays ignore preset defaults  :-( */
  166.     if ( !arg[A_LIN] ) if ( GetVar( "HOSTNAME", hostname, 30, 0 ) != -1 ) arg[A_LIN] = (LONG)hostname;
  167.     if ( giveDefault ) { showdefaults(argd); result = 0; } else
  168.     {    /* now one indent level is missing! (I'm lazy *and* don't like goto's :) */
  169.     if ( arg[A_STE] || IsInteractive( Input() ) ) if ( !( mystderr = Open("*", MODE_OLDFILE) ) ) CUP("Sorry for the requester,\nbut: Unable to open '*' (stderr)!\n", 99);
  170.  
  171.     if ( !arg[A_LIN] && strcmp( (UBYTE *) arg[A_LIP], "" ) )
  172.             CUP(" Please specify paramter LOGINNAME=LIN\n or setenv 'HOSTNAME' instead! (To skip \n login chat specify LOGINPROMPT=LIP \"\".) ", 35)
  173.     if ( !arg[A_PW] && strcmp( (UBYTE *)arg[A_PWP], "" ) && strcmp( (UBYTE *)arg[A_LIP], "" ) )
  174.             CUP(" Please specify paramter PASSWORD=PW!\n (To skip password chat specify\n PASSWORDPROMPT=PWP \"\") ", 36)
  175.  
  176.     /* where to put the report of serial communication and sana status */
  177.     if ( ! arg[A_RPF] ) { if ( !arg[A_QUIET] ) repfile = Output(); }
  178.     else if ( ! ( repfile = Open((UBYTE *)arg[A_RPF], MODE_NEWFILE ) ) ) CUP1("Unable to create reportfile '%s'", arg[A_RPF], 21);
  179.  
  180.     if ( ! ReadConfig( (UBYTE *)arg[A_SCF], *(LONG *)arg[A_SAU], &serpara) ) CUP("Error reading sana configuration file!", 22);
  181.     if ( ( arg[A_AA] || !arg[A_NRC] ) && serpara.listen2CD )
  182.         msg("\
  183.  Warning: If you don't remove the 'CD' paramter from\n\
  184.           the sana configuration file, you will'\n\
  185.           have to manually 'online' the sana device \n\
  186.           on incomming calls.\n\
  187.           (To avoid this warning use NORECONNECT or NRC)",
  188.     *(LONG *)arg[A_SAU]);
  189.  
  190.     /* open slipdevice */
  191.     if ( ! ( sanaport = CreateMsgPort() ) ) CUP("Unable to create message port for sana device.", 23);
  192.     if ( ! ( sanaIOReq = CreateIORequest(sanaport, sizeof(*sanaIOReq) ) ) ) CUP ("Unable to create IORequest for sanal line.", 24);
  193.     if ( sanaopenerr = OpenDevice((UBYTE *)arg[A_SAD], *(LONG *)arg[A_SAU], (struct IORequest *)sanaIOReq, 0L)) CUP1("Unable to open sana device '%s'.",arg[A_SAD], 25);
  194.  
  195.     /**********************************************/
  196.     /* Sana ONLINE                                  */
  197.     /**********************************************/
  198.     if ( ABBREV((UBYTE *)arg[A_CMD], "ON" ) )
  199.         { putOnline = TRUE; result = 0;    }
  200.  
  201.     /**********************************************/
  202.     /* Sana OFFLINE                                   */
  203.     /**********************************************/
  204.     else if ( ABBREV((UBYTE *)arg[A_CMD], "OF" ) )
  205.         {
  206.         sanaIOReq->ios2_Req.io_Command = S2_OFFLINE;
  207.         if ( DoIO( (struct IORequest *)sanaIOReq) ) CUP("Error in making sana device offline.", 26);
  208.         if ( repfile ) Write(Output(), WS("Sana offline\n"));
  209.         putOnline = FALSE; result = 0;
  210.         } else {
  211.  
  212.     /* now another indent level more missing! (I'm lazy *and* don't like goto's :) */
  213.  
  214.     /* get receivebuffer */
  215.     if ( ! ( rxbuffer = AllocMem(RXBUFSIZE, 0) ) ) CUP("Unable get memory for receive buffer.", 27);
  216.  
  217.     /* open timer device */
  218.     if ( ! ( timeport = CreateMsgPort() ) ) CUP("Unable to create message port for timer device.", 28);
  219.     if ( ! ( timereq = (struct timerequest *)CreateIORequest( timeport, sizeof( struct timerequest ) ) ) ) CUP ("Unable to create IORequest for timer device.", 29);
  220.     if ( timeopenerr = OpenDevice(TIMERNAME, UNIT_VBLANK, (struct IORequest *)timereq, 0L) )    CUP("Timer device did not open.", 30);
  221.  
  222.     /* open serial device */
  223.     if ( ! ( serialport = CreateMsgPort() ) ) CUP("Unable to create message port for serial line.", 31);
  224.     serialport->mp_Node.ln_Name = SERPORTNAME;
  225.     serialport->mp_Node.ln_Pri    = -1;
  226.     AddPort(serialport);
  227.     if ( ! ( serialIOReq = (struct IOExtSer *) CreateIORequest( serialport, sizeof(struct IOExtSer) ) ) ) CUP ("Unable to create IORequest for serial line.", 32);
  228.     serialIOReq->io_SerFlags = 0;
  229.     if ( seropenerr = OpenDevice(serpara.serDevName, serpara.serUnit, (struct IORequest *)serialIOReq, 0) )
  230.         {
  231.         sanaIOReq->ios2_Req.io_Command = S2_OFFLINE;
  232.         if ( repfile ) Write(Output(), WS("Sana offline\n"));
  233.         if ( DoIO( (struct IORequest *)sanaIOReq) ) CUP("Error in sana offline for opening serial device.", 33);
  234.         if ( seropenerr = OpenDevice(serpara.serDevName, serpara.serUnit, (struct IORequest *)serialIOReq, 0) ) CUP("Serial device did not open (even with slip offline!).", 34 );
  235.         putOnline = TRUE;
  236.         }
  237.  
  238.     if ( !initSerialLine(&serpara) ) CUP("Error initalizing serial line", 39 )
  239.  
  240.     result = 10;    /* so far, so good ..  No fatal errors anymore */
  241.  
  242.     /**********************************************/
  243.     /* TAKE                                          */
  244.     /**********************************************/
  245.     if ( ABBREV((UBYTE *)arg[A_CMD], "TA" ) )
  246.         {
  247.         if ( carrier() ) putOnline = TRUE;
  248.         else
  249.             {
  250.             if ( (result = take( varbuf ) < 10 ) ) putOnline = TRUE;
  251.             else /* something went wrong */
  252.                 {    /* hangup if we are running without user */
  253.                 if ( ! IsInteractive( Input() ) ) if ( ! hangup(varbuf) ) hangup(varbuf);
  254.                 if ( ! arg[A_QUIET] ) msg("Failed to take call!");
  255.                 }
  256.             }
  257.         }
  258.  
  259.     /**********************************************/
  260.     /* CONNECT, TOGGLE                              */
  261.     /**********************************************/
  262.     else if ( ( ABBREV((UBYTE *)arg[A_CMD], "TO" ) && !carrier() ) || ABBREV((UBYTE *)arg[A_CMD], "CO" ) )
  263.         {
  264.         if ( carrier() )
  265.             {
  266.             if ( !arg[A_QUIET] ) msg("Modem is already online!\n(carrier detected)");
  267.             result = 5;
  268.             }
  269.         else
  270.             {
  271.             if ( connect(varbuf) )
  272.                 {
  273.                 putOnline = TRUE;
  274.                 result = 1;
  275.                 }
  276.             else /* something went wrong */
  277.                 {
  278.                 if ( ! IsInteractive( Input() ) ) if ( ! hangup(varbuf) ) hangup(varbuf);
  279.                 if ( ! arg[A_QUIET] ) msg("Failed to connect!");
  280.                 }
  281.             }
  282.         }
  283.  
  284.     /**********************************************/
  285.     /* HANGUP and TOGGLE                          */
  286.     /**********************************************/
  287.     else if ( ( ABBREV((UBYTE *)arg[A_CMD], "TO" ) && carrier() ) || ( ABBREV((UBYTE *)arg[A_CMD], "HA" ) ) )
  288.         {
  289.         if ( hangup(varbuf) ) result = 0; 
  290.         if ( !arg[A_QUIET] && ( result >= 10 || carrier() ) )
  291.             msg("Failed to disconnect!");
  292.         else {
  293.             if ( arg[A_AA] ) putOnline = TRUE;    /* put online after hangup for taking incomming calls */
  294.             else             putOnline = FALSE;    /* put offline after hangup */
  295.             }
  296.         }
  297.  
  298.     /**********************************************/
  299.     /* QUERY modem                                  */
  300.     /**********************************************/
  301.     else if ( ABBREV((UBYTE *)arg[A_CMD], "QU" ) )
  302.         {
  303.         if ( query(varbuf) ) result = 2;
  304.         }
  305.  
  306.     /**********************************************/
  307.     /* CARRIER DETECT and make online if present  */
  308.     /**********************************************/
  309.     else if ( ABBREV((UBYTE *)arg[A_CMD], "CD" ) || ABBREV((UBYTE *)arg[A_CMD], "CARRIERDETECT" ) )
  310.         {
  311.         if ( carrier() )
  312.             { putOnline = TRUE;    result = 5;    }
  313.         else
  314.             { putOnline = FALSE; result = 0; }
  315.         }
  316.  
  317.     /**********************************************/
  318.     /* CHECK for carrier                          */
  319.     /**********************************************/
  320.     else if ( ABBREV((UBYTE *)arg[A_CMD], "CH" ) )
  321.         { result = carrier() ? 5 : 0; }
  322.  
  323.     /*********/
  324.     /* Usage */
  325.     /*********/
  326.     else giveusage = TRUE;
  327.  
  328.     };
  329.     };
  330.  
  331. cleanup:
  332.  
  333.     if ( ! seropenerr )
  334.         {
  335.         if ( result >= 10 ) DeleteVar( "SLIPCARRIER", GVF_GLOBAL_ONLY );
  336.         else SetVar( "SLIPCARRIER", carrier() ? "ON" : "OFF" , -1, GVF_GLOBAL_ONLY );
  337.  
  338.         CloseDevice((struct IORequest*)serialIOReq);
  339.         }
  340.  
  341.     if ( ! sanaopenerr )
  342.         {
  343.         if ( putOnline )
  344.             {
  345.             sanaIOReq->ios2_Req.io_Command = S2_ONLINE;
  346.             if ( DoIO((struct IORequest *)sanaIOReq) ) result = 10;
  347.             else if ( repfile ) Write(Output(), WS("Sana online\n"));
  348.             }
  349.         CloseDevice((struct IORequest*)sanaIOReq);
  350.         };
  351.  
  352.     if ( ! timeopenerr)
  353.         {
  354.         if ( ! CheckIO( (struct IORequest *)timereq ) ) AbortIO( (struct IORequest *)timereq );
  355.         CloseDevice( (struct IORequest *)timereq );
  356.         }
  357.  
  358.     if ( serialport )    {
  359.                         if ( serialport->mp_Node.ln_Name ) RemPort(serialport);
  360.                         DeleteMsgPort(serialport);
  361.                         };
  362.     if ( serialIOReq )    DeleteIORequest((struct IORequest*)serialIOReq);
  363.     if ( sanaport )        DeleteMsgPort(sanaport);
  364.     if ( sanaIOReq )    DeleteIORequest((struct IORequest*)sanaIOReq);
  365.     if ( timeport )        DeleteMsgPort( timeport );
  366.     if ( timereq )        DeleteIORequest( timereq );
  367.  
  368.     /* usage after closing serial device and (maybe) online of sana: */
  369.      if ( giveusage )    msg("%s\n\n\
  370. Unknow command '%s'. Valid Commands are:\n\n\
  371. COnnect, HAngup, TOggle, TAke, QUery,\n\
  372. ONline, OFfline, CarrierDetect and CHeck.\n\
  373. The default COMMAND is TOGGLE (CONNECT/HANGUP).\n\
  374. \n\
  375. To get the parameter template use '%s ?'.\n\
  376. \n\
  377. TEST does a modem internal loopback test and no real connect.\n\
  378. RINGS does only take effect after HANGUP with AUTOANSWER.\n\
  379. Use COnnect QUIET before every netappli. to ensure connection.\n\
  380. Add '%s CD' to user-startup to online after reboot\n\n\
  381. To get the paramter defaults use %s DEfault <parameter>|ALL",
  382. &version[6], (UBYTE *)arg[A_CMD], prgname, prgname, prgname);
  383.  
  384.     if ( rxbuffer )        FreeMem( rxbuffer, RXBUFSIZE );
  385.     if ( arg[A_RPF] && repfile )
  386.                         Close( repfile );
  387.     if ( rdclargs )        FreeArgs( rdclargs );
  388.      if ( rdenvargs )    {
  389.                         FreeArgs( rdenvargs );
  390.                         FreeDosObject(DOS_RDARGS, rdenvargs);
  391.                         };
  392.     if ( varbuf )        FreeMem( varbuf, VARBUFSIZE );
  393.     if ( template )        FreeMem( template, TEMPLATESIZE );
  394.     if ( mystderr )        Close(mystderr);
  395.     return( result );
  396.     }
  397.  
  398. void
  399. adjustdefs()
  400.     {
  401.     if ( arg[A_SCF] == argtab[A_SCF].deflt && ( strstr( (UBYTE *)arg[A_SAD], "ppp" ) || strstr( (UBYTE *)arg[A_SAD], "PPP" ) ) )
  402.         arg[A_SCF] = (LONG)"ppp%d.config";
  403.     if ( arg[A_VERBOSE] && !arg[A_RPF] ) arg[A_RPF] = (LONG)"CON:50/50/400/200/Dialup(VEROSE)/CLOSE/INACTIVE/WAIT";
  404.     }
  405.